package cn.zhqr.lib.bean.response;

/**
 * 错误码，以及错误描述
 * Created by charles on 2016/9/12.
 */
public enum ErrorCode {
    SUCCESS(0,"成功"),
    //1000~2000 api调用层级的错误
    UNKNOWN(1000,"未知异常"),
    INVALID_PARAM(1001,"参数错误"),
    METHOD_NOT_ALLOWED(1002,"请求方式不被允许"),
    OPERATE_TOO_FREQUENT(1003,"操作过于频繁"),
    OPERATE_DENIED(1403,"不允许该操作"),

    //2000~3000 稍后重试有可能解决问题
    NETWORK_ERROR(2001,"网络异常"),
    DEVICE_OFFLINE(2002,"设备离线"),
    DEVICE_SETTING_ERROR(2003,"设备配置有误"),
    DEVICE_BUSY(2010,"设备忙碌"),
    DEVICE_UNBIND(2011,"设备尚未绑定网点"),

    //3000~4000  业务层面错误
    USER_NOT_EXIST(3001,"用户名不存在"),
    LOGIN_FAILED(3002,"用户名或密码错误"),
    OLD_PWD_INCORRECT(3003,"原始密码不正确"),
    USER_NOT_REGISTER(3004,"用户未注册"),
    USER_NOT_BIND_WEIXIN(3005,"用户未绑定微信"),
    USER_NOT_JOIN_UNION(3006,"用户尚未加盟"),
    USER_PROFILE_NOT_COMPLETED(3007,"资料未完善"),
    BALANCE_NOT_ENOUGH(3008,"账户余额不足"),
    GET_BANK_INFO_FAILED(3009,"检测不到银行卡"),
    NOT_BIND_MOBILE(3010,"尚未绑定手机号"),
    INVALID_WEIXIN_AUTHCODE(3011,"无效的微信授权码"),
    WEIXIN_AUTH_FAILED(3012,"微信授权失败"),
    PAY_FAILED(3013,"支付失败"),
    REFUND_FAILED(3014,"退款失败"),
    NO_WASH_CARD(3015,"没有可用的洗车卡"),
    NO_PERMISSION_WASH_CARD(3016,"无权使用该卡"),
    WASH_CARD_USED_UP(3017,"该洗车卡已用完"),
    WASH_CARD_EXPIRED(3018,"该洗车卡已过期"),
    WASH_CARD_TODAY_USED_UP(3019,"今日次数已用完"),
    WASH_CARD_IN_USE(3021,"该卡正在使用中"),
    UN_AUTH(3022,"尚未认证"),



    DIFFERENT_BRAND(3030,"品牌标识不一致"),
    ACCOUNT_NOT_REGISTER(3040,"账户未开通"),
    NOT_LOGIN(3049,"用户名未登录"),
    LOGIN_TIMEOUT(3050,"登录超时"),
    USER_INACTIVE(3051,"用户不活跃"),
    PARTLY_FAILED(3060,"批量操作，部分失败"),
//    PARTLY_FAILED(3061,"任务执行中"),


    DEVICE_NOT_EXISTS(3100,"设备不存在"),

    DEVICE_SUSPEND(3110,"设备暂停运营"),
    ORDER_OVER_AMOUNT(3201,"订单超过最大金额"),
    ORDER_OVER_TIME(3202,"订单超过最大时长"),
    WITHDRAW_OVER_AMOUNT(3203,"提现金额超过限额"),


    PERMISSION_DENY(4000,"权限不足"),
    REPEAT_SUBMISSION(4001,"重复提交"),

    //5000~6000 严重错误，需要开发人员处理
    SERVER_ERROR(5001,"服务器错误，请联系管理员"),
    DATABASE_ERROR(5002,"数据库错误，请联系管理员"),
    SQL_ERROR(5003,"数据库SQL错误"),
    DATABASE_TRANSACTION_ERROR(5003,"数据库事务执行失败"),
    CERT_ERROR(5003,"证书错误，请联系管理员"),
    ;
    public String msg;
    public int code;

    ErrorCode(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }
}
